package com.lms.desiginmode.builder;

import com.lms.desiginmode.builder.endpointbuilder.Endpoint;
import com.lms.desiginmode.builder.endpointbuilder.EndpointBuilder;
import lombok.Data;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-12-12 16:21
 * @Description:
 */
@Data
public class CPU implements Endpoint {
    private String name;
    private Double usage;

    public static class CPUBuilder implements EndpointBuilder {
        CPU cpu=new CPU();

        public CPUBuilder name(String name){
            cpu.name=name;
            return this;
        }
        public CPUBuilder usage(Double usage){
            cpu.usage=usage;
            return this;
        }

        @Override
        public CPU build(){
            return  cpu;
        }

    }

}
